<?php

class DefaultController extends Controller {

    public $content = array();

    public function actionIndex() {
        $this->layout = 'main_search';
        
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/theme.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/base.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/css.css");
         Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/profile.css");

        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/account_settings.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/search.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/jquery-ui.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/chat.css");
        
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/jquery-1.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/lib.js");
                Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/community.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/onload.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/lib.json2.min.js");

        
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/jquery-ui-1.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/jquery-mods.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia_rtn_slide.js");
        
         Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/menu.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/logger.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.theming.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/stacktrace-min-0.3.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.ba-bbq.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/index.js");

        
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.cookie.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.base64.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/moment.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat-1.0.js?d=20131009.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat.ui-1.0.js?d=20131009.js");

        $criteria = new CDbCriteria();
        //$criteria->addCondition('profile.looking=:looking');
        //$criteria->params[':looking'] = 1;
		$abc='test';
        if (isset($_GET['txtethnicity']) && $_GET['txtethnicity']) {
            $abc = $_GET['txtethnicity'];
            $ethnicity = implode(',', $abc);
            if ($ethnicity != 0) {
                $criteria->addCondition('profile.ethnicity IN (' . $ethnicity . ')');
            } else {
                $criteria->addCondition('profile.ethnicity NOT IN (' . $ethnicity . ')');
            }
        }
		
        if (isset($_GET['txtreligion']) && $_GET['txtreligion']) {
            $religion = implode(',', $_GET['txtreligion']);
            if ($religion != 0) {
                $criteria->addCondition('profile.religion IN (' . $religion . ')');
            } else {
                $criteria->addCondition('profile.religion NOT IN (' . $religion . ')');
            }
        }
        if (isset($_GET['txtzodiac']) && $_GET['txtzodiac']) {
            $zodiac = implode(',', $_GET['txtzodiac']);
            if ($zodiac != 0) {
                $criteria->addCondition('profile.zodiac IN (' . $zodiac . ')');
            } else {
                $criteria->addCondition('profile.zodiac NOT IN (' . $zodiac . ')');
            }
        }

        if (isset($_GET['lookingfor']) && $_GET['lookingfor']) {
            $lookingfor = implode(',', $_GET['lookingfor']);
            if ($lookingfor != 0) {
                $criteria->addCondition('profile.looking IN (' . $lookingfor . ')');
            } else {
                $criteria->addCondition('profile.looking NOT IN (' . $lookingfor . ')');
            }
        }

        if (isset($_GET['status']) && $_GET['status']) {
            $status = implode(',', $_GET['status']);
            if ($status != 0) {
                $criteria->addCondition('profile.marial_status IN (' . $status . ')');
            } else {
                $criteria->addCondition('profile.marial_status NOT IN (' . $status . ')');
            }
        }

        if (isset($_GET['smokeing']) && $_GET['smokeing']) {
            $smokeing = implode(',', $_GET['smokeing']);
            if ($smokeing != 0) {
                $criteria->addCondition('profile.smoke IN (' . $smokeing . ')');
            } else {
                $criteria->addCondition('profile.smoke NOT IN (' . $smokeing . ')');
            }
        }
        if (isset($_GET['children']) && $_GET['children']) {
            $children = implode(',', $_GET['children']);
            if ($children == 1) {
                $criteria->addCondition('profile.children IN (0)');
            } else if ($children == 2) {
                $criteria->addCondition('profile.children IN (1,2,3,4,5,6,7,8,9)');
            } else {
                $criteria->addCondition('profile.children IN (0,1,2,3,4,5,6,7,8,9)');
            }
        }

        if (isset($_GET['MinAgeTextBox']) && $_GET['MinAgeTextBox'] && isset($_GET['MaxAgeTextBox']) && $_GET['MaxAgeTextBox']) {
            $min = $_GET['MinAgeTextBox'];
            $max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' (YEAR(NOW()) - YEAR(profile.birthdate)) >= :min and (YEAR(NOW()) - YEAR(profile.birthdate)) <= :max');
            $criteria->params[':min'] = $min;
            $criteria->params[':max'] = $max;
        }

        if (isset($_GET['MinHeight']) && $_GET['MinHeight'] && isset($_GET['MaxHeight']) && $_GET['MaxHeight']) {
            $min = $_GET['MinHeight'];
            $max = $_GET['MaxHeight'];
            $criteria->addBetweenCondition('profile.tall', $min, $max);
        }
        
        
        if (isset($_GET['Location']) && $_GET['Location']) {
            $country = $_GET['Location'];
            $criteria->addCondition('profile.country = :country');
            $criteria->params[':country'] = $country;
        }
        
        /*if (isset($_GET['ZipTextBox']) && $_GET['ZipTextBox']) {
            $postcode = $_GET['ZipTextBox'];
            $criteria->addCondition('profile.postcode LIKE '%:postcode%'');
            $criteria->params[':postcode'] = $postcode;
        }*/
        
        
       /*if (isset($_GET['hasphotos']) && $_GET['hasphotos']) {
            $hasphotos = $_GET['hasphotos'];
            echo $hasphotos;
            if ($hasphotos == 1) {
                $criteria->addCondition('avatar <> null');
            }else {
                $criteria->addCondition('avatar = null');
            }

        }*/

        $count = User::model()->with('profile')->with('userPhoto')->count($criteria);

        $pages = new CPagination($count);
        $pages->pageSize = 10;
        $pages->applyLimit($criteria);
        
        $countries = Countrie::model()->findAll();

        $models = User::model()->with('profile')->with('userPhoto')->findAll($criteria);
		
		
	
		$act = '';
		if (isset($_GET['act']) && $_GET['act']) {
            $act = $_GET['act'];
        }
		if($act != 'search'){
			$this->render('index', compact('models', 'pages', 'count','countries'));
		}else if($act == 'search') {
		
		}
		
    }
    
     public function actionResultSearch() {
         $criteria = new CDbCriteria();

        if (isset($_GET['txtethnicity']) && $_GET['txtethnicity']) {
            $abc = $_GET['txtethnicity'];
            $ethnicity = implode(',', $abc);
            if ($ethnicity != 0) {
                $criteria->addCondition('profile.ethnicity IN (' . $ethnicity . ')');
            } else {
                $criteria->addCondition('profile.ethnicity NOT IN (' . $ethnicity . ')');
            }
        }
		
        if (isset($_GET['txtreligion']) && $_GET['txtreligion']) {
            $religion = implode(',', $_GET['txtreligion']);
            if ($religion != 0) {
                $criteria->addCondition('profile.religion IN (' . $religion . ')');
            } else {
                $criteria->addCondition('profile.religion NOT IN (' . $religion . ')');
            }
        }
        if (isset($_GET['txtzodiac']) && $_GET['txtzodiac']) {
            $zodiac = implode(',', $_GET['txtzodiac']);
            if ($zodiac != 0) {
                $criteria->addCondition('profile.zodiac IN (' . $zodiac . ')');
            } else {
                $criteria->addCondition('profile.zodiac NOT IN (' . $zodiac . ')');
            }
        }

        if (isset($_GET['lookingfor']) && $_GET['lookingfor']) {
            $lookingfor = implode(',', $_GET['lookingfor']);
            if ($lookingfor != 0) {
                $criteria->addCondition('profile.looking IN (' . $lookingfor . ')');
            } else {
                $criteria->addCondition('profile.looking NOT IN (' . $lookingfor . ')');
            }
        }

        if (isset($_GET['status']) && $_GET['status']) {
            $status = implode(',', $_GET['status']);
            if ($status != 0) {
                $criteria->addCondition('profile.marial_status IN (' . $status . ')');
            } else {
                $criteria->addCondition('profile.marial_status NOT IN (' . $status . ')');
            }
        }

        if (isset($_GET['smokeing']) && $_GET['smokeing']) {
            $smokeing = implode(',', $_GET['smokeing']);
            if ($smokeing != 0) {
                $criteria->addCondition('profile.smoke IN (' . $smokeing . ')');
            } else {
                $criteria->addCondition('profile.smoke NOT IN (' . $smokeing . ')');
            }
        }
        if (isset($_GET['children']) && $_GET['children']) {
            $children = implode(',', $_GET['children']);
            if ($children == 1) {
                $criteria->addCondition('profile.children IN (0)');
            } else if ($children == 2) {
                $criteria->addCondition('profile.children IN (1,2,3,4,5,6,7,8,9)');
            } else {
                $criteria->addCondition('profile.children IN (0,1,2,3,4,5,6,7,8,9)');
            }
        }

        if (isset($_GET['MinAgeTextBox']) && $_GET['MinAgeTextBox'] && isset($_GET['MaxAgeTextBox']) && $_GET['MaxAgeTextBox']) {
            $min = $_GET['MinAgeTextBox'];
            $max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' (YEAR(NOW()) - YEAR(profile.birthdate)) >= :min and (YEAR(NOW()) - YEAR(profile.birthdate)) <= :max');
            $criteria->params[':min'] = $min;
            $criteria->params[':max'] = $max;
        }

        if (isset($_GET['MinHeight']) && $_GET['MinHeight'] && isset($_GET['MaxHeight']) && $_GET['MaxHeight']) {
            $min = $_GET['MinHeight'];
            $max = $_GET['MaxHeight'];
            $criteria->addBetweenCondition('profile.tall', $min, $max);
        }
        
        if (isset($_GET['Location']) && $_GET['Location']) {
            $country = $_GET['Location'];
            $criteria->addCondition('profile.country = :country');
            $criteria->params[':country'] = $country;
        }
        
        /*if (isset($_GET['ZipTextBox']) && $_GET['ZipTextBox']) {
            $postcode = $_GET['ZipTextBox'];
            $criteria->addCondition('profile.postcode LIKE '%:postcode%'');
            $criteria->params[':postcode'] = $postcode;
        }*/
        
        
       /*if (isset($_GET['hasphotos']) && $_GET['hasphotos']) {
            $hasphotos = $_GET['hasphotos'];
            echo $hasphotos;
            if ($hasphotos == 1) {
                $criteria->addCondition('avatar <> null');
            }else {
                $criteria->addCondition('avatar = null');
            }

        }*/
		
	/*if (isset($_GET['searchsortby'])== 1 ) {
            //$max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' DATEDIFF(NOW(),created_at) > 30');

        }*/
		
         $count = User::model()->with('profile')->with('userPhoto')->count($criteria);

        $pages = new CPagination($count);
        $pages->pageSize = 10;
        $pages->applyLimit($criteria);
        
        $countries = Countrie::model()->findAll();

        $models = User::model()->with('profile')->with('userPhoto')->findAll($criteria);
		
         $this->renderPartial('resultsearch',  compact('models','pages','count'));
    }
    
    
    
    
    public function actionOnlineSearch() {
        
        
        $criteria = new CDbCriteria();

        if (isset($_GET['txtethnicity']) && $_GET['txtethnicity']) {
            $abc = $_GET['txtethnicity'];
            $ethnicity = implode(',', $abc);
            if ($ethnicity != 0) {
                $criteria->addCondition('profile.ethnicity IN (' . $ethnicity . ')');
            } else {
                $criteria->addCondition('profile.ethnicity NOT IN (' . $ethnicity . ')');
            }
        }
		
        if (isset($_GET['txtreligion']) && $_GET['txtreligion']) {
            $religion = implode(',', $_GET['txtreligion']);
            if ($religion != 0) {
                $criteria->addCondition('profile.religion IN (' . $religion . ')');
            } else {
                $criteria->addCondition('profile.religion NOT IN (' . $religion . ')');
            }
        }
        if (isset($_GET['txtzodiac']) && $_GET['txtzodiac']) {
            $zodiac = implode(',', $_GET['txtzodiac']);
            if ($zodiac != 0) {
                $criteria->addCondition('profile.zodiac IN (' . $zodiac . ')');
            } else {
                $criteria->addCondition('profile.zodiac NOT IN (' . $zodiac . ')');
            }
        }

        if (isset($_GET['lookingfor']) && $_GET['lookingfor']) {
            $lookingfor = implode(',', $_GET['lookingfor']);
            if ($lookingfor != 0) {
                $criteria->addCondition('profile.looking IN (' . $lookingfor . ')');
            } else {
                $criteria->addCondition('profile.looking NOT IN (' . $lookingfor . ')');
            }
        }

        if (isset($_GET['status']) && $_GET['status']) {
            $status = implode(',', $_GET['status']);
            if ($status != 0) {
                $criteria->addCondition('profile.marial_status IN (' . $status . ')');
            } else {
                $criteria->addCondition('profile.marial_status NOT IN (' . $status . ')');
            }
        }

        if (isset($_GET['smokeing']) && $_GET['smokeing']) {
            $smokeing = implode(',', $_GET['smokeing']);
            if ($smokeing != 0) {
                $criteria->addCondition('profile.smoke IN (' . $smokeing . ')');
            } else {
                $criteria->addCondition('profile.smoke NOT IN (' . $smokeing . ')');
            }
        }
        if (isset($_GET['children']) && $_GET['children']) {
            $children = implode(',', $_GET['children']);
            if ($children == 1) {
                $criteria->addCondition('profile.children IN (0)');
            } else if ($children == 2) {
                $criteria->addCondition('profile.children IN (1,2,3,4,5,6,7,8,9)');
            } else {
                $criteria->addCondition('profile.children IN (0,1,2,3,4,5,6,7,8,9)');
            }
        }

        if (isset($_GET['MinAgeTextBox']) && $_GET['MinAgeTextBox'] && isset($_GET['MaxAgeTextBox']) && $_GET['MaxAgeTextBox']) {
            $min = $_GET['MinAgeTextBox'];
            $max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' (YEAR(NOW()) - YEAR(profile.birthdate)) >= :min and (YEAR(NOW()) - YEAR(profile.birthdate)) <= :max');
            $criteria->params[':min'] = $min;
            $criteria->params[':max'] = $max;
        }

        if (isset($_GET['MinHeight']) && $_GET['MinHeight'] && isset($_GET['MaxHeight']) && $_GET['MaxHeight']) {
            $min = $_GET['MinHeight'];
            $max = $_GET['MaxHeight'];
            $criteria->addBetweenCondition('profile.tall', $min, $max);
        }
        
        if (isset($_GET['Location']) && $_GET['Location']) {
            $country = $_GET['Location'];
            $criteria->addCondition('profile.country = :country');
            $criteria->params[':country'] = $country;
        }
        
        /*if (isset($_GET['ZipTextBox']) && $_GET['ZipTextBox']) {
            $postcode = $_GET['ZipTextBox'];
            $criteria->addCondition('profile.postcode LIKE '%:postcode%'');
            $criteria->params[':postcode'] = $postcode;
        }*/
        
        
       /*if (isset($_GET['hasphotos']) && $_GET['hasphotos']) {
            $hasphotos = $_GET['hasphotos'];
            echo $hasphotos;
            if ($hasphotos == 1) {
                $criteria->addCondition('avatar <> null');
            }else {
                $criteria->addCondition('avatar = null');
            }

        }*/
		
	/*if (isset($_GET['searchsortby'])== 1 ) {
            //$max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' DATEDIFF(NOW(),created_at) > 30');

        }*/
        
        $criteria->addCondition('is_online = 1');
		
        $count = User::model()->with('profile')->with('userPhoto')->count($criteria);

        $pages = new CPagination($count);
        $pages->pageSize = 10;
        $pages->applyLimit($criteria);
        
        $countries = Countrie::model()->findAll();

        $models = User::model()->with('profile')->with('userPhoto')->findAll($criteria);
		
         $this->renderPartial('onlinesearch',  compact('models','pages','count'));
    }
    
    public function actionGallerySearch() {
        
        $criteria = new CDbCriteria();

        if (isset($_GET['txtethnicity']) && $_GET['txtethnicity']) {
            $abc = $_GET['txtethnicity'];
            $ethnicity = implode(',', $abc);
            if ($ethnicity != 0) {
                $criteria->addCondition('profile.ethnicity IN (' . $ethnicity . ')');
            } else {
                $criteria->addCondition('profile.ethnicity NOT IN (' . $ethnicity . ')');
            }
        }
		
        if (isset($_GET['txtreligion']) && $_GET['txtreligion']) {
            $religion = implode(',', $_GET['txtreligion']);
            if ($religion != 0) {
                $criteria->addCondition('profile.religion IN (' . $religion . ')');
            } else {
                $criteria->addCondition('profile.religion NOT IN (' . $religion . ')');
            }
        }
        if (isset($_GET['txtzodiac']) && $_GET['txtzodiac']) {
            $zodiac = implode(',', $_GET['txtzodiac']);
            if ($zodiac != 0) {
                $criteria->addCondition('profile.zodiac IN (' . $zodiac . ')');
            } else {
                $criteria->addCondition('profile.zodiac NOT IN (' . $zodiac . ')');
            }
        }

        if (isset($_GET['lookingfor']) && $_GET['lookingfor']) {
            $lookingfor = implode(',', $_GET['lookingfor']);
            if ($lookingfor != 0) {
                $criteria->addCondition('profile.looking IN (' . $lookingfor . ')');
            } else {
                $criteria->addCondition('profile.looking NOT IN (' . $lookingfor . ')');
            }
        }

        if (isset($_GET['status']) && $_GET['status']) {
            $status = implode(',', $_GET['status']);
            if ($status != 0) {
                $criteria->addCondition('profile.marial_status IN (' . $status . ')');
            } else {
                $criteria->addCondition('profile.marial_status NOT IN (' . $status . ')');
            }
        }

        if (isset($_GET['smokeing']) && $_GET['smokeing']) {
            $smokeing = implode(',', $_GET['smokeing']);
            if ($smokeing != 0) {
                $criteria->addCondition('profile.smoke IN (' . $smokeing . ')');
            } else {
                $criteria->addCondition('profile.smoke NOT IN (' . $smokeing . ')');
            }
        }
        if (isset($_GET['children']) && $_GET['children']) {
            $children = implode(',', $_GET['children']);
            if ($children == 1) {
                $criteria->addCondition('profile.children IN (0)');
            } else if ($children == 2) {
                $criteria->addCondition('profile.children IN (1,2,3,4,5,6,7,8,9)');
            } else {
                $criteria->addCondition('profile.children IN (0,1,2,3,4,5,6,7,8,9)');
            }
        }

        if (isset($_GET['MinAgeTextBox']) && $_GET['MinAgeTextBox'] && isset($_GET['MaxAgeTextBox']) && $_GET['MaxAgeTextBox']) {
            $min = $_GET['MinAgeTextBox'];
            $max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' (YEAR(NOW()) - YEAR(profile.birthdate)) >= :min and (YEAR(NOW()) - YEAR(profile.birthdate)) <= :max');
            $criteria->params[':min'] = $min;
            $criteria->params[':max'] = $max;
        }

        if (isset($_GET['MinHeight']) && $_GET['MinHeight'] && isset($_GET['MaxHeight']) && $_GET['MaxHeight']) {
            $min = $_GET['MinHeight'];
            $max = $_GET['MaxHeight'];
            $criteria->addBetweenCondition('profile.tall', $min, $max);
        }
        
        if (isset($_GET['Location']) && $_GET['Location']) {
            $country = $_GET['Location'];
            $criteria->addCondition('profile.country = :country');
            $criteria->params[':country'] = $country;
        }
        
        /*if (isset($_GET['ZipTextBox']) && $_GET['ZipTextBox']) {
            $postcode = $_GET['ZipTextBox'];
            $criteria->addCondition('profile.postcode LIKE '%:postcode%'');
            $criteria->params[':postcode'] = $postcode;
        }*/
        
        
       /*if (isset($_GET['hasphotos']) && $_GET['hasphotos']) {
            $hasphotos = $_GET['hasphotos'];
            echo $hasphotos;
            if ($hasphotos == 1) {
                $criteria->addCondition('avatar <> null');
            }else {
                $criteria->addCondition('avatar = null');
            }

        }*/
		
	/*if (isset($_GET['searchsortby'])== 1 ) {
            //$max = $_GET['MaxAgeTextBox'];
            $criteria->addCondition(' DATEDIFF(NOW(),created_at) > 30');

        }*/
        
        
		
         $count = User::model()->with('profile')->with('userPhoto')->count($criteria);

        $pages = new CPagination($count);
        $pages->pageSize = 10;
        $pages->applyLimit($criteria);
        
        $countries = Countrie::model()->findAll();

        $models = User::model()->with('profile')->with('userPhoto')->findAll($criteria);
		
         $this->renderPartial('gallerysearch',  compact('models','pages','count'));
    }
    
    
      public function actionSearchUser() {
        
        if (isset($_GET['UsernameSearchTextBox'])) {

            $criteria = new CDbCriteria();
            if ($_GET['searchmethod'] == 1) {
                $criteria->addCondition('username=:username');
                $criteria->params[':username'] = $_GET['UsernameSearchTextBox'];
            } if ($_GET['searchmethod'] == 0) {
                $criteria->addSearchCondition('username', $_GET['UsernameSearchTextBox']);
            } else {

                $criteria->addCondition('username=:username');
            }
            $i = User::model()->with('profile')->with('userPhoto')->count($criteria);
            $pages = new CPagination(User::model()->count($criteria));
            $pages->pageSize = 10;
            $pages->applyLimit($criteria);
            $models = User::model()->with('profile')->with('userPhoto')->findAll($criteria);
        }
        $this->renderPartial('searchuser', compact('models', 'pages', 'i'));
    }
    
     public function actionTodaymatchs() {
         
          Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/theme.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/base.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/css.css");
        
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/peoplemedia.js", CClientScript::POS_BEGIN);
      Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/jquery_002.js", CClientScript::POS_BEGIN);
      Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/js1/Profile.js", CClientScript::POS_BEGIN);
        
        $criteria = new CDbCriteria();
        $criteria->order = 'RAND(5)';
        $models = User::model()->with('profile','userPhoto')->find($criteria);
        $this->renderPartial('todaymatchs',compact('models')); 
        
         //echo 'abc';
       // YII::app()->end();
    }
    

}
